﻿using CopyBaron.Properties;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace CopyBaron.Model
{
    public class CopyBaronSettings
    {
        public bool TrimText { get; set; }
        public bool RemoveLineBreaks { get; set; }
        public bool RemoveDoubleWhitespaces { get; set; }
        public bool ReplaceTabs { get; set; }
        public string TabReplacement { get; set; }
        public bool ActivatePreviousApplication { get; set; }
        public bool SendCtrlV { get; set; }
        public bool PlaySound { get; set; }

        public static CopyBaronSettings CreateFromAppConfig()
        {
            var settings = Settings.Default;

            var CopyBaronSettings = new CopyBaronSettings()
            {
                TrimText = settings.TrimText,
                RemoveLineBreaks = settings.RemoveLineBreaks,
                RemoveDoubleWhitespaces = settings.RemoveDoubleWhitespaces,
                ReplaceTabs = settings.ReplaceTabs,
                TabReplacement = settings.TabReplacement,
                ActivatePreviousApplication = settings.ActivatePreviousApplication,
                SendCtrlV = settings.SendCtrlV,
                PlaySound = settings.PlaySound,
            };

            return CopyBaronSettings;
        }
    }
}
